home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00a.txt / 000016_icon-group-sender _Mon Jan 24 08:29:36 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  3KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA29177
  4.     for icon-group-addresses; Mon, 24 Jan 2000 08:27:31 -0700 (MST)
  5. Message-Id: <200001241527.IAA29177@baskerville.CS.Arizona.EDU>
  6. From: Bob Ardler <ardler@argonet.co.uk>
  7. To: <icon-group@optima.CS.Arizona.EDU>
  8. Date: Sun, 23 Jan 2000 12:04:01 +0000 (GMT)
  9. Subject: permutations a la real Icon
  10. User-Agent: Pluto/1.13f (RISC-OS/3.60)
  11. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  12. Status: RO
  13.  
  14. (Thread called 'Question' or 'permutations', etc)
  15.  
  16. Steve Graham:
  17. > Marc Espie:
  18. > >suspend l[i to *l] <-> l[i] & permute(l, i+1)
  19.  
  20. >I don't really understand what's going on here.  I gather there's a
  21. >reversible assignment being used and a recursive call.  Can you shed
  22. >some light on this?
  23.  
  24. Me too. My iterative Basic permuter transcribed to Icon, FORs to
  25. everys, is embarrassingly long and 20% slower than Marc's.
  26.  
  27. Marc Espie's program is real Icon as opposed to the
  28. Algol-with-singing-dancing-strings subset of Icon which, as a
  29. non-programmer I use for small text or numeric jobs.
  30.  
  31. No doubt time or urgency or an on-site guru or intelligence transplant
  32. would enable one to learn real Icon, exploiting generators, suspension
  33. and coexpressions.
  34.  
  35. However I believe there is a pedagogic problem here. I have the Griswold
  36. book, 3rd edition. It's the best manual, best text-book and best primer
  37. I've seen, all in under 400 pages. A remarkable achievement, evidence
  38. that some computer scientists may be human.
  39.  
  40. Yet their patient chapters on string scanning and co-expressions couldn't
  41. penetrate this skull. I think the missing pedagogic tools are
  42.  
  43. (1) rigorous (as in maths) definitions and statements of the semantics
  44. involved
  45.  
  46. (2) historical asides explaining the origin of, eg, co-expressions
  47.  
  48. (3) a type of diagram, or perhaps a style of layout, which can show the
  49. flow of control in a statement like Marc's above.
  50.  
  51. I am thinking of how, since Algol, the physical layout with indentation
  52. of a procedural language has enabled learners and non-programmers to
  53. write short programs and see what's going on.
  54.  
  55. "char* yukk = squawk; while ( *squawk++ = *crep++ ) ; return yukk;" is
  56. just a gag. But 'real' Icon, like functional languages, is forced to have
  57. one-liners with many invisible lines of control flow.
  58.  
  59. I haven't seen text-book diagrams to exhibit the behaviour of generators
  60. or show the flow in suspension/resumption.
  61.  
  62. Do any of you have such things in your lecture notes or use them on the
  63. blackboard? Or know of texts which diagram or elucidate 'horizontal'
  64. control flow?
  65.  
  66. --
  67.  
  68. Bob Ardler,  ardler@argonet.co.uk
  69.  
  70.